package com.lab.webSocket.repository;

import com.lab.webSocket.dto.ChatLogDto;
import com.lab.webSocket.model.ChatLogEntity;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.math.BigInteger;
import java.util.List;

/**
 * Created by xu_jiaHui on 2017/8/31.
 */
public interface ChatLogRepository extends CrudRepository<ChatLogEntity, Long> {

    /**
     * @Description: 获取最近的 离线后的消息
     * @author xu_jiaHui
     * @date 2017/9/7 20:12
     */
    public List<ChatLogDto> getLastChatLog(String userAccount) throws Exception;


    @Modifying
    @Query(value = "delete from ChatLogEntity where chatLogId=?1")
    public Integer deleteChatLog(Integer chatLogId) throws Exception;
}
